import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:whale/helper/utils/util.dart';
import 'package:whale/pages/means/main/index.dart';
import 'package:whale/pages/means/main/widgets/selection/index.dart';

// class MeansSelectView extends GetView<MeansController> {
//   const MeansSelectView({Key? key}) : super(key: key);

//   @override
//   Widget build(BuildContext context) {
//     var state = controller.state;
//     return Container(
//         height: 50.r,
//         decoration: BoxDecoration(
//           color: Colors.white,
//           borderRadius: BorderRadius.circular(10.r),
//         ),
//         child: BrnSelectionView(
//           originalSelectionData: [
//             BrnSelectionEntity(title: '地区', children: [
//               BrnSelectionEntity(
//                 title: '河南',
//                 showType: 'list',
//                 isSelected: true,
//                 type: 'checkbox',
//                 value: '0',
//                 children: [
//                   BrnSelectionEntity(
//                       title: '郑州', type: 'checkbox', value: '0-1'),
//                   BrnSelectionEntity(
//                       title: '开封', type: 'checkbox', value: '0-2'),
//                 ],
//               ),
//               BrnSelectionEntity(
//                 title: '河北',
//                 showType: 'list',
//                 isSelected: true,
//                 type: 'checkbox',
//                 value: '1',
//                 children: [
//                   BrnSelectionEntity(
//                       title: '太原', type: 'checkbox', value: '1-1'),
//                   BrnSelectionEntity(
//                       title: '石家庄', type: 'checkbox', value: '1-1'),
//                 ],
//               ),
//             ]),
//             BrnSelectionEntity(title: '领域'),
//             BrnSelectionEntity(
//               title: '更多筛选',
//               showType: 'range',
//               type: 'layer',
//             ),
//           ],
//           onSelectionChanged:
//               (menuIndex, selectedParams, customParams, setCustomMenuTitle) {},
//         ));
//   }
// }
class MeansSelectView extends StatelessWidget {
  const MeansSelectView({
    Key? key,
    required this.titles,
    required this.complete,
  }) : super(key: key);
  final List<SelectionModel> titles;
  final Function(SelectionResultModel res)? complete;
  @override
  Widget build(BuildContext context) {
    return Container(
      height: 44.r,
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(10.r),
      ),
      child: SelectionTitlesView(
        titles: titles,
        complete: complete,
      ),
    );
  }
}
